package io;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

/**
 *
 */
public class OOSDemo {
    public static void main(String[] args) throws Exception {
        Student s = new Student("name",18,"man", new String[]{"ccc"});
        FileOutputStream fos = new FileOutputStream("student.obj");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        ObjectOutputStream oos = new ObjectOutputStream(bos);

        oos.writeObject(s);

        System.out.println("写入完成");

        oos.close();

    }
}
